var login = Vue.component('login', {template:'#tpl---components-login',
    name: "Login",
    components: {},
    data() {
      return {
        form: {
          username: '001',
          password: ''
        },

        // 表单验证，需要在 el-form-item 元素中增加 prop 属性
        rules: {
          username: [
            {required: true, message: '账号不可为空', trigger: 'blur'}
          ],
          password: [
            {required: true, message: '密码不可为空', trigger: 'blur'}
          ]
        },

        // 对话框显示和隐藏
        dialogVisible: false
      }
    },
    methods: {
      onSubmit(formName) {
        // 为表单绑定验证功能
    var url = "/apis/su?wd=" + "aaa" ;
    axios.get(url).then(res=>{
      console.log(res);
    });
        this.$refs[formName].validate((valid) => {
          if (valid) {
            // 使用 vue-router 路由到指定页面，该方式称之为编程式导航
      // this.$refs["source"].src = "https://note.youdao.com/yws/public/note/1aba5ac66ab516557d0a99ea40b6e886?editorType=1";

      console.log(this);


            // this.$router.push("/Search/");
          } else {
            this.dialogVisible = true;
            return false;
          }
        });
      }
    }
  });
var about = Vue.component('about', {template:'#tpl---components-about',});
